Setting culling

In Kanzi render passes you can optimize the performance of meshes in your applications by setting the culling properties.

Setting the culling properties

To set the culling properties:

  1. In Library select Composing > Composers and the render pass you are using.
  2. In the Properties in the Culling properties set:
    • Enable the Frustum Culling property so that the mesh nodes, whose bounding boxes are not within the viewing frustum of the active camera, are not rendered.
    • Cull Mode to Back so that polygons whose normals point away from the active camera are not rendered.

Controlling culling

You can control culling for individual meshes. This is useful when, for example, a vertex shader radically modifies the geometry of objects, such as vertex skinned objects.

To control culling:

  1. In the Project select the object for which you want to control culling.
  2. In the Properties click Add Properties, and add Frustum Cull Margin property.
  3. Adjust the cull margin of the object.
    To see if your culling setting works as you intended it to work, in the Preview enter the Debug mode, select Performance HUD, and move the camera away from the object for which you want to control culling. When culling does not occur anymore for the object, Batch count value drops.

See also

Reducing the number of rendered vertices

Setting the correct size of vertex cache

Loading resources in parallel

Measuring the performance of your Kanzi application

Best practices